Skip to content

fix(s3-deployment): skip replacement pass when no source markers#37393

Open
garysassano wants to merge 3 commits intoaws:mainfrom
garysassano:fix/s3-deployment-no-marker-fast-path
Open

fix(s3-deployment): skip replacement pass when no source markers#37393
garysassano wants to merge 3 commits intoaws:mainfrom
garysassano:fix/s3-deployment-no-marker-fast-path

Conversation

@garysassano
Copy link
Copy Markdown
Contributor

Issue # (if applicable)

Closes #37234.

Reason for this change

BucketDeployment still walks extracted files for marker replacement even when a source has no markers. That adds unnecessary work for deployments that have nothing to substitute.

Description of changes

  • Add an early return in the Python aws-s3-deployment handler after extraction when the current source has no markers.
  • Keep the existing replacement behavior unchanged for sources that do contain markers.
  • Add a regression test to verify the handler does not call replace_markers() when the marker map is empty.

Describe any new or updated permissions being added

No new or updated IAM permissions are required.

Description of how you validated changes

  • Added a unit test for the empty-marker fast path.
  • Ran bash packages/@aws-cdk/custom-resource-handlers/test/aws-s3-deployment/bucket-deployment-handler/test.sh.

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions bot added bug This issue is a bug. effort/medium Medium work item – several days of effort p2 beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK labels Mar 29, 2026
@aws-cdk-automation aws-cdk-automation requested a review from a team March 29, 2026 23:07
Copy link
Copy Markdown
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This review is outdated)

@garysassano garysassano force-pushed the fix/s3-deployment-no-marker-fast-path branch from eac2447 to 5ef34f9 Compare March 30, 2026 18:49
@aws-cdk-automation aws-cdk-automation dismissed their stale review March 30, 2026 18:51

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 30, 2026

⚠️ Experimental Feature: This security report is currently in experimental phase. Results may include false positives and the rules are being actively refined.
This security report is NOT a review blocker. Please try merge from main to avoid findings unrelated to the PR.


TestsPassed ✅SkippedFailed
Security Guardian Results24 ran24 passed
TestResult
No test annotations available

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 30, 2026

⚠️ Experimental Feature: This security report is currently in experimental phase. Results may include false positives and the rules are being actively refined.
This security report is NOT a review blocker. Please try merge from main to avoid findings unrelated to the PR.


TestsPassed ✅SkippedFailed
Security Guardian Results with resolved templates24 ran24 passed
TestResult
No test annotations available

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK bug This issue is a bug. effort/medium Medium work item – several days of effort p2

Projects

None yet

2 participants